const mongoose = require('mongoose');

const commentSchema = new mongoose.Schema({
	//因为评论要和所评论的那一篇文章相对应，所以要有文章id
	aid:{
		type:mongoose.Schema.Types.ObjectId,
		ref:'Article'
	},
	//用户id
	uid:{
		type:mongoose.Schema.Types.ObjectId,
		ref:'User'
	},
	//评论时间
	time:{
		type:Date
	},
	//评论内容
	content:{
		type:String
	}
});

const Comment = mongoose.model('Comment',commentSchema);


module.exports={
	Comment:Comment
}